package com.hainingtong.core.util;

import java.util.HashMap;
import java.util.Map;

public class RedisUtil {
    // 暂时替代redis的作用，后面改成reids
    private static final Map<String, Object> data = new HashMap<>();

    // synchronized 保证线程安全
    public synchronized static void save(String key, Object value){
        data.put(key,value);
    }

    public synchronized static Object get(String key){
        try {
            return data.get(key);
        }catch (Exception e){
            e.printStackTrace();
            return "";
        }
    }
}
